package com.softer.chengxin.home.controller;

import com.softer.chengxin.common.domin.ManagerPageResult;
import com.softer.chengxin.home.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * @author Gong Zhiyang
 * @date 2018/9/26
 */
@RestController
public class MessageController {

    @Autowired
    private MessageService messageService;

    /**
     * 物业企业-信息通知，例如：加分减分，审核通过、不通过等
     *
     * @param page    页码
     * @param limit   数量
     * @param session session
     * @return 结果
     */
    @PostMapping("/api/Home/GetMessageList")
    public ManagerPageResult getMessageList(Integer page, Integer limit, HttpSession session) {
        //查询企业ID
        Integer id = (Integer) session.getAttribute("ID");
        return messageService.getMessageList(page, limit, id);
    }


}